import React, { Component } from 'react'
import Item from '../Item/Item'
import './List.css'
export default class List extends Component {
  render() {
    const { updateTodo, list, delTodo, editId, setEditId, editTodoName } =
      this.props
    return (
      <ul className="todo-main">
        {list.map((item) => {
          return (
            <Item
              key={item.id}
              todo={item}
              updateTodo={updateTodo}
              delTodo={delTodo}
              editId={editId}
              setEditId={setEditId}
              editTodoName={editTodoName}
            ></Item>
          )
        })}
        {/* [<Item todo={吃饭}></Item>,<Item todo={睡觉}></Item>] */}
      </ul>
    )
  }
}
